home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / include / plplot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-12  |  38.6 KB  |  1,489 lines

  1. /* $Id: plplot.h,v 1.70 1994/08/25 05:19:18 mjl Exp $
  2.  * $Log: plplot.h,v $
  3.  * Revision 1.70  1994/08/25  05:19:18  mjl
  4.  * Bumped version number.
  5.  *
  6.  * Revision 1.69  1994/07/29  20:17:02  mjl
  7.  * Added typedef for new PLCursor struct and driver escape code for the get
  8.  * cursor operation (contributed by Paul Casteels).  Added prototypes for
  9.  * plmap() and plmeridians() (contributed by Wesley Ebisuzaki).
  10.  *
  11.  * Revision 1.68  1994/07/28  08:04:49  mjl
  12.  * Bumped version number, revision to various comments.
  13.  *
  14.  * Revision 1.67  1994/07/20  06:07:09  mjl
  15.  * Changed names and prototypes for the new 3d functions -- now plline3(),
  16.  * plpoin3(), and plpoly3().
  17.  *
  18.  * Revision 1.66  1994/07/19  22:14:45  furnish
  19.  * Stuff for pl3poly().
  20.  *
  21.  * Revision 1.65  1994/07/15  20:37:12  furnish
  22.  * Added routines pl3line and pl3poin for drawing lines and points in 3
  23.  * space.  Added a new example program, and dependency info to build it.
  24.  *
  25.  * Revision 1.64  1994/07/12  19:18:00  mjl
  26.  * Fixed prototype for plshade().
  27.  *
  28.  * Revision 1.63  1994/06/30  18:33:36  mjl
  29.  * Now includes math.h and string.h, since I was tired of getting burned by
  30.  * leaving these out (and having strange run-time errors as a result).  The
  31.  * PLINT type now is an "int" by default, except on MSDOS where it's a long
  32.  * (16 bits not being enough).  The latter can be modified under 32 bit
  33.  * compilation systems to use an int also.  So currently, you can use an
  34.  * int as a PLINT on all systems except MSDOS, there you must use PLINT.
  35.  *
  36.  * Revision 1.62  1994/06/16  19:48:36  mjl
  37.  * Inserted prototype for pltkMain(), removed prototype for plframeCmd().
  38. */
  39.  
  40. /*
  41.     plplot.h
  42.  
  43.     Copyright (C) 1992 by
  44.     Maurice J. LeBrun, Geoff Furnish, Tony Richardson.
  45.  
  46.     Macros and prototypes for the PLplot package.  This header file must
  47.     be included by all user codes.
  48.  
  49.     This software may be freely copied, modified and redistributed
  50.     without fee provided that this copyright notice is preserved intact
  51.     on all copies and modified copies.
  52.  
  53.     There is no warranty or other guarantee of fitness of this software.
  54.     It is provided solely "as is". The author(s) disclaim(s) all
  55.     responsibility and liability with respect to this software's usage
  56.     or its effect upon hardware or computer systems.
  57.  
  58.     Note: some systems allow the Fortran & C namespaces to clobber each
  59.     other.  So for PLplot to work from Fortran, we do some rather nasty
  60.     things to the externally callable C function names.  This shouldn't
  61.     affect any user programs in C as long as this file is included.
  62. */
  63.  
  64. #ifndef __PLPLOT_H__
  65. #define __PLPLOT_H__
  66.  
  67. #define PLPLOT_VERSION "4.99i"
  68.  
  69. /*----------------------------------------------------------------------*\
  70.  *    USING PLplot
  71.  *
  72.  * To use PLplot from C or C++, it is only necessary to
  73.  *
  74.  *      #include "plplot.h"
  75.  *
  76.  * This file does all the necessary setup to make PLplot accessible to
  77.  * your program as documented in the manual.  Additionally, this file
  78.  * allows you to request certain behavior by defining certain symbols
  79.  * before inclusion.  At the moment the only one is:
  80.  *
  81.  * #define DOUBLE    or..
  82.  * #define PL_DOUBLE
  83.  *
  84.  * This causes PLplot to use doubles instead of floats.  Use the type
  85.  * PLFLT everywhere in your code, and it will always be the right thing.
  86.  *
  87.  * Note: most of the functions visible here begin with "pl", while all
  88.  * of the data types and switches begin with "PL".  Eventually everything
  89.  * will conform to this rule in order to keep namespace pollution of the
  90.  * user code to a minimum.  All the PLplot source files actually include
  91.  * "plplotP.h", which includes this file as well as all the internally-
  92.  * visible declarations, etc.
  93. \*----------------------------------------------------------------------*/
  94.  
  95. /* The majority of PLplot source files require these, so.. */
  96. /* Under ANSI C, they can be included any number of times */
  97.  
  98. #include <stdio.h>
  99. #include <stdlib.h>
  100.  
  101. /* I'm sick of being burned by forgetting math or string prototypes */
  102.  
  103. #include <math.h>
  104. #include <string.h>
  105.  
  106. /*----------------------------------------------------------------------*\
  107.  *        SYSTEM IDENTIFICATION
  108.  *
  109.  * Several systems are supported directly by PLplot.  In order to avoid
  110.  * confusion, one id macro per system is used.  Since different compilers
  111.  * may predefine different system id macros, we need to check all the
  112.  * possibilities, and then set the one we will be referencing.  These are:
  113.  *
  114.  * __cplusplus                Any C++ compiler
  115.  * __unix                     Any Unix-like system
  116.  * __hpux                     Any HP/UX system
  117.  * __aix                      Any AIX system
  118.  * __linux                    Linux for i386
  119.  * __riscos              Acorn RISC OS
  120.  * (others...)
  121.  *
  122. \*----------------------------------------------------------------------*/
  123.  
  124. /* This will hopefully catch compilers that don't fully conform */
  125.  
  126. #ifndef __STDC__
  127. #ifndef __cplusplus
  128. If you reach this line, it means your compiler is incapable of building
  129. PLplot (not ANSI-compliant).  Time to get a new one.
  130. #endif
  131. #endif
  132.  
  133. #ifdef unix            /* the old way */
  134. #ifndef __unix
  135. #define __unix
  136. #endif
  137. #endif
  138.  
  139. /* Make sure Unix systems define "__unix" */
  140.  
  141. #if defined(SX)    ||                /* NEC Super-UX */      \
  142.     (defined(_IBMR2) && defined(_AIX)) ||    /* AIX */               \
  143.     defined(__hpux) ||                /* HP/UX */             \
  144.     defined(sun) ||                /* SUN */               \
  145.     defined(CRAY) ||                /* Cray */              \
  146.     defined(__convexc__) ||            /* CONVEX */            \
  147.     (defined(__alpha) && defined(__osf__))    /* DEC Alpha AXP/OSF */
  148.  
  149. #ifndef __unix
  150. #define __unix
  151. #endif
  152. #endif
  153.  
  154. /* A wrapper used in some header files so they can be compiled with cc */
  155.  
  156. #define PLARGS(a)    a
  157.  
  158. /*----------------------------------------------------------------------*\
  159.  * Base types for PLplot
  160.  *
  161.  * Only those that are necessary for function prototypes are defined here.
  162.  * Notes:
  163.  *
  164.  * PLINT is typedef'd to an int by default.  This is a change from some
  165.  * previous versions, where a long was used.  Under MSDOS, a PLINT is
  166.  * typedef'd to a long, since 16 bits is too inaccurate for some PLplot
  167.  * functions.  So under MSDOS you must use type PLINT for integer array
  168.  * arguments to PLplot functions, but on other systems you can just use
  169.  * an int.
  170.  *
  171.  * short is currently used for device page coordinates, so they are
  172.  * bounded by (-32767, 32767).  This gives a max resolution of about 3000
  173.  * dpi, and improves performance in some areas over using a PLINT.
  174. \*----------------------------------------------------------------------*/
  175.  
  176. #if defined(PL_DOUBLE) || defined(DOUBLE)
  177. typedef double PLFLT;
  178. #else
  179. typedef float PLFLT;
  180. #endif
  181.  
  182. #if defined(MSDOS)
  183. typedef long PLINT;
  184. #else
  185. typedef int PLINT;
  186. #endif
  187.  
  188. /* For passing user data, as with X's XtPointer */
  189.  
  190. typedef void* PLPointer;
  191.  
  192. /*----------------------------------------------------------------------*\
  193.  * Complex data types and other good stuff
  194. \*----------------------------------------------------------------------*/
  195.  
  196. /* Switches for escape function call. */
  197. /* Some of these are obsolete but are retained in order to process
  198.    old metafiles */
  199.  
  200. #define PLESC_SET_RGB        1    /* obsolete */
  201. #define PLESC_ALLOC_NCOL    2    /* obsolete */
  202. #define PLESC_SET_LPB        3    /* obsolete */
  203. #define PLESC_EXPOSE        4    /* handle window expose */
  204. #define PLESC_RESIZE        5    /* handle window resize */
  205. #define PLESC_REDRAW        6    /* handle window redraw */
  206. #define PLESC_TEXT        7    /* switch to text screen */
  207. #define PLESC_GRAPH        8    /* switch to graphics screen */
  208. #define PLESC_FILL        9    /* fill polygon */
  209. #define PLESC_DI        10    /* handle DI command */
  210. #define PLESC_FLUSH        11    /* flush output */
  211. #define PLESC_EH        12      /* handle Window events */
  212. #define PLESC_GETC        13    /* get cursor position */
  213.  
  214. /* PLplot Option table & support constants */
  215.  
  216. /* Option-specific settings */
  217.  
  218. #define PL_OPT_ENABLED        0x0001    /* Processing is enabled */
  219. #define PL_OPT_ARG        0x0002    /* Option has an argment */
  220. #define PL_OPT_NODELETE        0x0004    /* Don't delete after processing */
  221. #define PL_OPT_INVISIBLE    0x0008    /* Make invisible */
  222.  
  223. /* Option-processing settings -- mutually exclusive */
  224.  
  225. #define PL_OPT_FUNC        0x0100    /* Call handler function */
  226. #define PL_OPT_BOOL        0x0200    /* Set *var = 1 */
  227. #define PL_OPT_INT        0x0400    /* Set *var = atoi(optarg) */
  228. #define PL_OPT_FLOAT        0x0800    /* Set *var = atof(optarg) */
  229. #define PL_OPT_STRING        0x1000    /* Set var = optarg */
  230.  
  231. /* Global mode settings */
  232. /* These override per-option settings */
  233.  
  234. #define PL_PARSE_PARTIAL    0x0000    /* For backward compatibility */
  235. #define PL_PARSE_FULL        0x0001    /* Process fully & exit if error */
  236. #define PL_PARSE_QUIET        0x0002    /* Don't issue messages */
  237. #define PL_PARSE_NODELETE    0x0004    /* Don't delete options after */
  238.                     /* processing */
  239. #define PL_PARSE_SHOWALL    0x0008    /* Show invisible options */
  240. #define PL_PARSE_OVERRIDE    0x0010    /* Overrides internal option(s) */
  241. #define PL_PARSE_NOPROGRAM    0x0020    /* Program name NOT in *argv[0].. */
  242. #define PL_PARSE_NODASH        0x0040    /* Set if leading dash NOT required */
  243.  
  244. typedef struct {
  245.     char *opt;
  246.     int  (*handler)    (char *, char *, void *);
  247.     void *client_data;
  248.     void *var;
  249.     long mode;
  250.     char *syntax;
  251.     char *desc;
  252. } PLOptionTable;
  253.  
  254. /* PLplot Key structure */
  255.  
  256. #define PL_NKEYSTRING 20
  257.  
  258. typedef struct {
  259.     unsigned long code;
  260.     char string[PL_NKEYSTRING];
  261. } PLKey;
  262.  
  263. /* PLplot Mouse structure */
  264.  
  265. typedef struct {
  266.     int button;
  267.     int state;
  268.     PLFLT x;
  269.     PLFLT y;
  270. } PLMouse;
  271.  
  272. /* Window structure for doing resizes without calling the X driver directly */
  273. /* May add other attributes in time */
  274.  
  275. typedef struct {
  276.     unsigned int width;
  277.     unsigned int height;
  278. } PLWindow;
  279.  
  280. /* Macro used (in some cases) to ignore value of argument */
  281. /* I don't plan on changing the value so you can hard-code it */
  282.  
  283. #define PL_NOTSET (-42)
  284.  
  285. /* See plcont.c for examples of the following */
  286.  
  287. /*
  288.  * PLfGrid is for passing (as a pointer to the first element) an arbitrarily
  289.  * dimensioned array.  The grid dimensions MUST be stored, with a maximum of 3
  290.  * dimensions assumed for now.
  291.  */
  292.  
  293. typedef struct {
  294.     PLFLT *f;
  295.     PLINT nx, ny, nz;
  296. } PLfGrid;
  297.  
  298. /*
  299.  * PLfGrid2 is for passing (as an array of pointers) a 2d function array.  The
  300.  * grid dimensions are passed for possible bounds checking.
  301.  */
  302.  
  303. typedef struct {
  304.     PLFLT **f;
  305.     PLINT nx, ny;
  306. } PLfGrid2;
  307.  
  308. /*
  309.  * NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet
  310.  * so I'll leave it out for now.
  311.  */
  312.  
  313. /*
  314.  * PLcGrid is for passing (as a pointer to the first element) arbitrarily
  315.  * dimensioned coordinate transformation arrays.  The grid dimensions MUST be
  316.  * stored, with a maximum of 3 dimensions assumed for now.
  317.  */
  318.  
  319. typedef struct {
  320.     PLFLT *xg, *yg, *zg;
  321.     PLINT nx, ny, nz;
  322. } PLcGrid;
  323.  
  324. /*
  325.  * PLcGrid2 is for passing (as arrays of pointers) 2d coordinate
  326.  * transformation arrays.  The grid dimensions are passed for possible bounds
  327.  * checking.
  328.  */
  329.  
  330. typedef struct {
  331.     PLFLT **xg, **yg, **zg;
  332.     PLINT nx, ny;
  333. } PLcGrid2;
  334.  
  335. /*
  336.  * NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet
  337.  * so I'll leave it out for now.
  338.  */
  339.  
  340. /* PLColor is the usual way to pass an rgb color value. */
  341.  
  342. typedef struct {
  343.     unsigned char r, g, b;
  344. } PLColor;
  345.  
  346. /* PLControlPt is how cmap1 control points are represented. */
  347.  
  348. typedef struct {
  349.     PLFLT h, l, s, p;
  350. } PLControlPt;
  351.  
  352. /* For returning the coordinates of the cursor */
  353.  
  354. typedef struct {
  355.     PLFLT vpX, vpY, wX, wY;
  356. } PLCursor;
  357.  
  358. /*----------------------------------------------------------------------*\
  359.  *        BRAINDEAD-ness
  360.  *
  361.  * Some systems allow the Fortran & C namespaces to clobber each other.
  362.  * For PLplot to work from Fortran on these systems, we must name the the
  363.  * externally callable C functions something other than their Fortran entry
  364.  * names.  In order to make this as easy as possible for the casual user,
  365.  * yet reversible to those who abhor my solution, I have done the
  366.  * following:
  367.  *
  368.  *    The C-language bindings are actually different from those
  369.  *    described in the manual.  Macros are used to convert the
  370.  *    documented names to the names used in this package.  The
  371.  *    user MUST include plplot.h in order to get the name
  372.  *    redefinition correct.
  373.  *
  374.  * Sorry to have to resort to such an ugly kludge, but it is really the
  375.  * best way to handle the situation at present.  If all available
  376.  * compilers offer a way to correct this stupidity, then perhaps we can
  377.  * eventually reverse it (there is a way now, by defining NOBRAINDEAD, but
  378.  * be careful because this will totally hose the Fortran interface on some
  379.  * systems).  If you feel like screaming at someone (I sure do), please
  380.  * direct it at your nearest system vendor who has a braindead shared
  381.  * C/Fortran namespace.  Some vendors do offer compiler switches that
  382.  * change the object names, but then everybody who wants to use the
  383.  * package must throw these same switches, leading to no end of trouble.
  384.  *
  385.  * Note that this definition should not cause any noticable effects except
  386.  * when debugging PLplot calls, in which case you will need to remember
  387.  * the real function names (same as before but with a 'c_' prepended).
  388.  *
  389.  * Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded
  390.  * in the stub routines.
  391.  *
  392.  * Aside: the reason why a shared Fortran/C namespace is deserving of the
  393.  * BRAINDEAD characterization is that it completely precludes the the kind
  394.  * of universal API that is attempted (more or less) with PLplot, without
  395.  * Herculean efforts (e.g. remapping all of the C bindings by macros as
  396.  * done here).  The vendors of such a scheme, in order to allow a SINGLE
  397.  * type of argument to be passed transparently between C and Fortran,
  398.  * namely, a pointer to a conformable data type, have slammed the door on
  399.  * insertion of stub routines to handle the conversions needed for other
  400.  * data types.  Intelligent linkers could solve this problem, but these are
  401.  * not anywhere close to becoming universal.  So meanwhile, one must live
  402.  * with either stub routines for the inevitable data conversions, or a
  403.  * different API.  The former is what is used here, but is made far more
  404.  * difficult in a braindead shared Fortran/C namespace.
  405. \*----------------------------------------------------------------------*/
  406.  
  407. #ifndef BRAINDEAD
  408. #define BRAINDEAD
  409. #endif
  410.  
  411. #ifdef NOBRAINDEAD
  412. #undef BRAINDEAD
  413. #endif
  414.  
  415. #ifdef BRAINDEAD
  416.  
  417. #ifndef __PLSTUBS_H__    /* i.e. do not expand this in the stubs */
  418.  
  419. #define    pladv    c_pladv
  420. #define    plaxes    c_plaxes
  421. #define    plbin    c_plbin
  422. #define    plbop    c_plbop
  423. #define    plbox    c_plbox
  424. #define    plbox3    c_plbox3
  425. #define    plcol0    c_plcol0
  426. #define    plcol1    c_plcol1
  427. #define    plcont    c_plcont
  428. #define    plcpstrm    c_plcpstrm
  429. #define    plend    c_plend
  430. #define    plend1    c_plend1
  431. #define    plenv    c_plenv
  432. #define    pleop    c_pleop
  433. #define    plerrx    c_plerrx
  434. #define    plerry    c_plerry
  435. #define    plfamadv    c_plfamadv
  436. #define    plfill    c_plfill
  437. #define    plflush    c_plflush
  438. #define    plfont    c_plfont
  439. #define    plfontld    c_plfontld
  440. #define    plgchr    c_plgchr
  441. #define    plgcol0    c_plgcol0
  442. #define    plgcolbg    c_plgcolbg
  443. #define    plgdidev    c_plgdidev
  444. #define    plgdiori    c_plgdiori
  445. #define    plgdiplt    c_plgdiplt
  446. #define    plgfam    c_plgfam
  447. #define    plgfnam    c_plgfnam
  448. #define    plgpage    c_plgpage
  449. #define    plgphy    c_plgphy
  450. #define    plgra    c_plgra
  451. #define    plgspa    c_plgspa
  452. #define    plgstrm    c_plgstrm
  453. #define    plgver    c_plgver
  454. #define    plgxax    c_plgxax
  455. #define    plgyax    c_plgyax
  456. #define    plgzax    c_plgzax
  457. #define    plhist    c_plhist
  458. #define    plhls        c_plhls
  459. #define    plinit    c_plinit
  460. #define    pljoin    c_pljoin
  461. #define    pllab    c_pllab
  462. #define    plline    c_plline
  463. #define    plline3    c_plline3
  464. #define    pllsty    c_pllsty
  465. #define    plmesh    c_plmesh
  466. #define    plmkstrm    c_plmkstrm
  467. #define    plmtex    c_plmtex
  468. #define    plot3d    c_plot3d
  469. #define    plpat    c_plpat
  470. #define    plpoin    c_plpoin
  471. #define    plpoin3    c_plpoin3
  472. #define    plpoly3    c_plpoly3
  473. #define    plprec    c_plprec
  474. #define    plpsty    c_plpsty
  475. #define    plptex    c_plptex
  476. #define    plreplot    c_plreplot
  477. #define    plrgb    c_plrgb
  478. #define    plrgb1    c_plrgb1
  479. #define    plsasp    c_plsasp
  480. #define    plschr    c_plschr
  481. #define    plscmap0    c_plscmap0
  482. #define    plscmap1    c_plscmap1
  483. #define    plscmap0n    c_plscmap0n
  484. #define    plscmap1n    c_plscmap1n
  485. #define    plscmap1l    c_plscmap1l
  486. #define    plscol0    c_plscol0
  487. #define    plscolbg    c_plscolbg
  488. #define    plscolor    c_plscolor
  489. #define    plsdev    c_plsdev
  490. #define    plsdiplt    c_plsdiplt
  491. #define    plsdiplz    c_plsdiplz
  492. #define    plsdidev    c_plsdidev
  493. #define    plsdimap    c_plsdimap
  494. #define    plsdiori    c_plsdiori
  495. #define    plsesc    c_plsesc
  496. #define    plsfam    c_plsfam
  497. #define    plsfnam    c_plsfnam
  498. #define    plshade    c_plshade
  499. #define    plshade1    c_plshade1
  500. #define    plslpb    c_plslpb
  501. #define    plsmaj    c_plsmaj
  502. #define    plsmin    c_plsmin
  503. #define    plsori    c_plsori
  504. #define    plspage    c_plspage
  505. #define    plspause    c_plspause
  506. #define    plsstrm    c_plsstrm
  507. #define    plssub    c_plssub
  508. #define    plssym    c_plssym
  509. #define    plstar    c_plstar
  510. #define    plstart    c_plstart
  511. #define    plstyl    c_plstyl
  512. #define    plsvpa    c_plsvpa
  513. #define    plsxax    c_plsxax
  514. #define    plsyax    c_plsyax
  515. #define    plsym    c_plsym
  516. #define    plszax    c_plszax
  517. #define    pltext    c_pltext
  518. #define    plvasp    c_plvasp
  519. #define    plvpas    c_plvpas
  520. #define    plvpor    c_plvpor
  521. #define    plvsta    c_plvsta
  522. #define    plw3d    c_plw3d
  523. #define    plwid    c_plwid
  524. #define    plwind    c_plwind
  525.  
  526. #endif /* __PLSTUBS_H__ */
  527.  
  528. #else
  529.  
  530. #define    c_pladv    pladv
  531. #define    c_plaxes    plaxes
  532. #define    c_plbin    plbin
  533. #define    c_plbop    plbop
  534. #define    c_plbox    plbox
  535. #define    c_plbox3    plbox3
  536. #define    c_plcol0    plcol0
  537. #define    c_plcol1    plcol1
  538. #define    c_plcpstrm    plcpstrm
  539. #define    c_plcont    plcont
  540. #define    c_plend    plend
  541. #define    c_plend1    plend1
  542. #define    c_plenv    plenv
  543. #define    c_pleop    pleop
  544. #define    c_plerrx    plerrx
  545. #define    c_plerry    plerry
  546. #define    c_plfamadv    plfamadv
  547. #define    c_plfill    plfill
  548. #define    c_plflush    plflush
  549. #define    c_plfont    plfont
  550. #define    c_plfontld    plfontld
  551. #define    c_plgchr    plgchr
  552. #define    c_plgcol0    plgcol0
  553. #define    c_plgcolbg    plgcolbg
  554. #define    c_plgdidev    plgdidev
  555. #define    c_plgdiori    plgdiori
  556. #define    c_plgdiplt    plgdiplt
  557. #define    c_plgfam    plgfam
  558. #define    c_plgfnam    plgfnam
  559. #define    c_plgpage    plgpage
  560. #define    c_plgra    plgra
  561. #define    c_plgspa    plgspa
  562. #define    c_plgstrm    plgstrm
  563. #define    c_plgver    plgver
  564. #define    c_plgxax    plgxax
  565. #define    c_plgyax    plgyax
  566. #define    c_plgzax    plgzax
  567. #define    c_plhist    plhist
  568. #define    c_plhls    plhls
  569. #define    c_plinit    plinit
  570. #define    c_pljoin    pljoin
  571. #define    c_pllab    pllab
  572. #define    c_plline    plline
  573. #define    c_plline3    plline3
  574. #define    c_pllsty    pllsty
  575. #define    c_plmesh    plmesh
  576. #define    c_plmkstrm    plmkstrm
  577. #define    c_plmtex    plmtex
  578. #define    c_plot3d    plot3d
  579. #define    c_plpat    plpat
  580. #define    c_plpoin    plpoin
  581. #define    c_plpoin3    plpoin3
  582. #define    c_plpoly3    plpoly3
  583. #define    c_plprec    plprec
  584. #define    c_plpsty    plpsty
  585. #define    c_plptex    plptex
  586. #define    c_plreplot    plreplot
  587. #define    c_plrgb    plrgb
  588. #define    c_plrgb1    plrgb1
  589. #define    c_plsasp    plsasp
  590. #define    c_plschr    plschr
  591. #define    c_plscmap0    plscmap0
  592. #define    c_plscmap1    plscmap1
  593. #define    c_plscmap0n    plscmap0n
  594. #define    c_plscmap1n    plscmap1n
  595. #define    c_plscmap1l    plscmap1l
  596. #define    c_plscol0    plscol0
  597. #define    c_plscolbg    plscolbg
  598. #define    c_plscolor    plscolor
  599. #define    c_plsdev    plsdev
  600. #define    c_plsdiplt    plsdiplt
  601. #define    c_plsdiplz    plsdiplz
  602. #define    c_plsdidev    plsdidev
  603. #define    c_plsdimap    plsdimap
  604. #define    c_plsdiori    plsdiori
  605. #define    c_plsesc    plsesc
  606. #define    c_plsfam    plsfam
  607. #define    c_plsfnam    plsfnam
  608. #define    c_plshade    plshade
  609. #define    c_plshade1    plshade1
  610. #define    c_plslpb    plslpb
  611. #define    c_plsmaj    plsmaj
  612. #define    c_plsmin    plsmin
  613. #define    c_plsori    plsori
  614. #define    c_plspage    plspage
  615. #define    c_plspause    plspause
  616. #define    c_plsstrm    plsstrm
  617. #define    c_plssub    plssub
  618. #define    c_plssym    plssym
  619. #define    c_plstar    plstar
  620. #define    c_plstart    plstart
  621. #define    c_plstyl    plstyl
  622. #define    c_plsvpa    plsvpa
  623. #define    c_plsxax    plsxax
  624. #define    c_plsyax    plsyax
  625. #define    c_plsym    plsym
  626. #define    c_plszax    plszax
  627. #define    c_pltext    pltext
  628. #define    c_plvasp    plvasp
  629. #define    c_plvpas    plvpas
  630. #define    c_plvpor    plvpor
  631. #define    c_plvsta    plvsta
  632. #define    c_plw3d    plw3d
  633. #define    c_plwid    plwid
  634. #define    c_plwind    plwind
  635.  
  636. #endif    /* BRAINDEAD */
  637.  
  638. /* Redefine some old function names for backward compatibility */
  639.  
  640. #ifndef __PLSTUBS_H__    /* i.e. do not expand this in the stubs */
  641.  
  642. #define    plclr    pleop
  643. #define    plpage    plbop
  644. #define    plcol    plcol0
  645. #define    plcontf    plfcont
  646. #define       Alloc2dGrid    plAlloc2dGrid
  647. #define       Free2dGrid    plFree2dGrid
  648.  
  649. #endif /* __PLSTUBS_H__ */
  650.  
  651. /*----------------------------------------------------------------------*\
  652.  *        Function Prototypes
  653. \*----------------------------------------------------------------------*/
  654.  
  655. #ifdef __cplusplus
  656. extern "C" {
  657. #endif
  658.  
  659.     /* All void types */
  660.  
  661.     /* C routines callable from stub routines come first */
  662.  
  663. /* Advance to subpage "page", or to the next one if "page" = 0. */
  664.  
  665. void
  666. c_pladv(PLINT page);
  667.  
  668. /* This functions similarly to plbox() except that the origin of the axes */
  669. /* is placed at the user-specified point (x0, y0). */
  670.  
  671. void
  672. c_plaxes(PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub,
  673.      const char *yopt, PLFLT ytick, PLINT nysub);
  674.  
  675. /* Plot a histogram using x to store data values and y to store frequencies */
  676.  
  677. void
  678. c_plbin(PLINT nbin, PLFLT *x, PLFLT *y, PLINT center);
  679.  
  680. /* Start new page.  Should only be used with pleop(). */
  681.  
  682. void
  683. c_plbop(void);
  684.  
  685. /* This draws a box around the current viewport. */
  686.  
  687. void
  688. c_plbox(const char *xopt, PLFLT xtick, PLINT nxsub,
  689.     const char *yopt, PLFLT ytick, PLINT nysub);
  690.  
  691. /* This is the 3-d analogue of plbox(). */
  692.  
  693. void
  694. c_plbox3(const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx,
  695.      const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby,
  696.      const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz);
  697.  
  698. /* Set color, map 0.  Argument is integer between 0 and 15. */
  699.  
  700. void
  701. c_plcol0(PLINT icol0);
  702.  
  703. /* Set color, map 1.  Argument is a float between 0. and 1. */
  704.  
  705. void
  706. c_plcol1(PLFLT col1);
  707.  
  708. /* Draws a contour plot from data in f(nx,ny).  Is just a front-end to
  709.  * plfcont, with a particular choice for f2eval and f2eval_data.
  710.  */
  711.  
  712. void
  713. c_plcont(PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx,
  714.      PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
  715.      void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
  716.      PLPointer pltr_data);
  717.  
  718. /* Draws a contour plot using the function evaluator f2eval and data stored
  719.  * by way of the f2eval_data pointer.  This allows arbitrary organizations
  720.  * of 2d array data to be used.
  721.  */
  722.  
  723. void
  724. plfcont(PLFLT (*f2eval) (PLINT, PLINT, PLPointer),
  725.     PLPointer f2eval_data,
  726.     PLINT nx, PLINT ny, PLINT kx, PLINT lx,
  727.     PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
  728.     void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
  729.     PLPointer pltr_data);
  730.  
  731. /* Copies state parameters from the reference stream to the current stream. */
  732.  
  733. void
  734. c_plcpstrm(PLINT iplsr, PLINT flags);
  735.  
  736. /* Converts input values from relative device coordinates to relative plot */
  737. /* coordinates. */
  738.  
  739. void
  740. pldid2pc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax);
  741.  
  742. /* Converts input values from relative plot coordinates to relative */
  743. /* device coordinates. */
  744.  
  745. void
  746. pldip2dc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax);
  747.  
  748. /* End a plotting session for all open streams. */
  749.  
  750. void
  751. c_plend(void);
  752.  
  753. /* End a plotting session for the current stream only. */
  754.  
  755. void
  756. c_plend1(void);
  757.  
  758. /* Simple interface for defining viewport and window. */
  759.  
  760. void
  761. c_plenv(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
  762.     PLINT just, PLINT axis);
  763.  
  764. /* End current page.  Should only be used with plbop(). */
  765.  
  766. void
  767. c_pleop(void);
  768.  
  769. /* Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) */
  770.  
  771. void
  772. c_plerrx(PLINT n, PLFLT *xmin, PLFLT *xmax, PLFLT *y);
  773.  
  774. /* Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) */
  775.  
  776. void
  777. c_plerry(PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax);
  778.  
  779. /* Advance to the next family file on the next new page */
  780.  
  781. void
  782. c_plfamadv(void);
  783.  
  784. /* Pattern fills the polygon bounded by the input points. */
  785.  
  786. void
  787. c_plfill(PLINT n, PLFLT *x, PLFLT *y);
  788.  
  789. /* Flushes the output stream.  Use sparingly, if at all. */
  790.  
  791. void
  792. c_plflush(void);
  793.  
  794. /* Sets the global font flag to 'ifont'. */
  795.  
  796. void
  797. c_plfont(PLINT ifont);
  798.  
  799. /* Load specified font set. */
  800.  
  801. void
  802. c_plfontld(PLINT fnt);
  803.  
  804. /* Get character default height and current (scaled) height */
  805.  
  806. void
  807. c_plgchr(PLFLT *p_def, PLFLT *p_ht);
  808.  
  809. /* Returns 8 bit RGB values for given color from color map 0 */
  810.  
  811. void
  812. c_plgcol0(PLINT icol0, PLINT *r, PLINT *g, PLINT *b);
  813.  
  814. /* Returns the background color by 8 bit RGB value */
  815.  
  816. void
  817. c_plgcolbg(PLINT *r, PLINT *g, PLINT *b);
  818.  
  819. /* Retrieve current window into device space */
  820.  
  821. void
  822. c_plgdidev(PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy);
  823.  
  824. /* Get plot orientation */
  825.  
  826. void
  827. c_plgdiori(PLFLT *p_rot);
  828.  
  829. /* Retrieve current window into plot space */
  830.  
  831. void
  832. c_plgdiplt(PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax);
  833.  
  834. /* Get family file parameters */
  835.  
  836. void
  837. c_plgfam(PLINT *p_fam, PLINT *p_num, PLINT *p_bmax);
  838.  
  839. /* Get the (current) output file name.  Must be preallocated to >80 bytes */
  840.  
  841. void
  842. c_plgfnam(char *fnam);
  843.  
  844. /* Get output device parameters. */
  845.  
  846. void
  847. c_plgpage(PLFLT *p_xp, PLFLT *p_yp,
  848.       PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff);
  849.  
  850. /* Switches to graphics screen. */
  851.  
  852. void
  853. c_plgra(void);
  854.  
  855. /* Get subpage boundaries in absolute coordinates */
  856.  
  857. void
  858. c_plgspa(PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax);
  859.  
  860. /* Get current stream number. */
  861.  
  862. void
  863. c_plgstrm(PLINT *p_strm);
  864.  
  865. /* Get the current library version number */
  866.  
  867. void
  868. c_plgver(char *p_ver);
  869.  
  870. /* Get x axis labeling parameters */
  871.  
  872. void
  873. c_plgxax(PLINT *p_digmax, PLINT *p_digits);
  874.  
  875. /* Get y axis labeling parameters */
  876.  
  877. void
  878. c_plgyax(PLINT *p_digmax, PLINT *p_digits);
  879.  
  880. /* Get z axis labeling parameters */
  881.  
  882. void
  883. c_plgzax(PLINT *p_digmax, PLINT *p_digits);
  884.  
  885. /* Draws a histogram of n values of a variable in array data[0..n-1] */
  886.  
  887. void
  888. c_plhist(PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax,
  889.      PLINT nbin, PLINT oldwin);
  890.  
  891. /* Set current color (map 0) by hue, lightness, and saturation. */
  892.  
  893. void
  894. c_plhls(PLFLT h, PLFLT l, PLFLT s);
  895.  
  896. /* Initializes PLplot, using preset or default options */
  897.  
  898. void
  899. c_plinit(void);
  900.  
  901. /* Draws a line segment from (x1, y1) to (x2, y2). */
  902.  
  903. void
  904. c_pljoin(PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2);
  905.  
  906. /* Simple routine for labelling graphs. */
  907.  
  908. void
  909. c_pllab(const char *xlabel, const char *ylabel, const char *tlabel);
  910.  
  911. /* Draws line segments connecting a series of points. */
  912.  
  913. void
  914. c_plline(PLINT n, PLFLT *x, PLFLT *y);
  915.  
  916. /* Draws a line in 3 space.  */
  917.  
  918. void
  919. c_plline3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z);
  920.  
  921. /* Set line style. */
  922.  
  923. void
  924. c_pllsty(PLINT lin);
  925.  
  926. /* plot continental outline in world coordinates */
  927.  
  928. void
  929. plmap(void (*mapform)(PLINT, PLFLT *, PLFLT *), char *type,
  930.       PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat);
  931.  
  932. /* Plot the latitudes and longitudes on the background. */
  933.  
  934. void
  935. plmeridians(void (*mapform)(PLINT, PLFLT *, PLFLT *),
  936.         PLFLT dlong, PLFLT dlat,
  937.         PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat);
  938.  
  939. /* Plots a mesh representation of the function z[x][y]. */
  940.  
  941. void
  942. c_plmesh(PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt);
  943.  
  944. /* Creates a new stream and makes it the default.  */
  945.  
  946. void
  947. c_plmkstrm(PLINT *p_strm);
  948.  
  949. /* Prints out "text" at specified position relative to viewport */
  950.  
  951. void
  952. c_plmtex(const char *side, PLFLT disp, PLFLT pos, PLFLT just,
  953.      const char *text);
  954.  
  955. /* Plots a 3-d representation of the function z[x][y]. */
  956.  
  957. void
  958. c_plot3d(PLFLT *x, PLFLT *y, PLFLT **z,
  959.      PLINT nx, PLINT ny, PLINT opt, PLINT side);
  960.  
  961. /* Set fill pattern directly. */
  962.  
  963. void
  964. c_plpat(PLINT nlin, PLINT *inc, PLINT *del);
  965.  
  966. /* Plots array y against x for n points using ASCII code "code".*/
  967.  
  968. void
  969. c_plpoin(PLINT n, PLFLT *x, PLFLT *y, PLINT code);
  970.  
  971. /* Draws a series of points in 3 space. */
  972.  
  973. void
  974. c_plpoin3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT code);
  975.  
  976. /* Draws a polygon in 3 space.  */
  977.  
  978. void
  979. c_plpoly3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw);
  980.  
  981. /* Set the floating point precision (in number of places) in numeric labels. */
  982.  
  983. void
  984. c_plprec(PLINT setp, PLINT prec);
  985.  
  986. /* Set fill pattern, using one of the predefined patterns.*/
  987.  
  988. void
  989. c_plpsty(PLINT patt);
  990.  
  991. /* Prints out "text" at world cooordinate (x,y). */
  992.  
  993. void
  994. c_plptex(PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, const char *text);
  995.  
  996. /* Replays contents of plot buffer to current device/file. */
  997.  
  998. void
  999. c_plreplot(void);
  1000.  
  1001. /* Set line color by red, green, blue from  0. to 1. */
  1002.  
  1003. void
  1004. c_plrgb(PLFLT r, PLFLT g, PLFLT b);
  1005.  
  1006. /* Set line color by 8 bit RGB values. */
  1007.  
  1008. void
  1009. c_plrgb1(PLINT r, PLINT g, PLINT b);
  1010.  
  1011. /* Obsolete.  Use page driver interface instead. */
  1012.  
  1013. void
  1014. c_plsasp(PLFLT asp);
  1015.  
  1016. /* Set character height. */
  1017.  
  1018. void
  1019. c_plschr(PLFLT def, PLFLT scale);
  1020.  
  1021. /* Set number of colors in cmap 0 */
  1022.  
  1023. void
  1024. c_plscmap0n(PLINT ncol0);
  1025.  
  1026. /* Set number of colors in cmap 1 */
  1027.  
  1028. void
  1029. c_plscmap1n(PLINT ncol1);
  1030.  
  1031. /* Set color map 0 colors by 8 bit RGB values */
  1032.  
  1033. void
  1034. c_plscmap0(PLINT *r, PLINT *g, PLINT *b, PLINT ncol0);
  1035.  
  1036. /* Set color map 1 colors by 8 bit RGB values */
  1037.  
  1038. void
  1039. c_plscmap1(PLINT *r, PLINT *g, PLINT *b, PLINT ncol1);
  1040.  
  1041. /* Set color map 1 colors using a piece-wise linear relationship between */
  1042. /* intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. */
  1043.  
  1044. void
  1045. c_plscmap1l(PLINT itype, PLINT npts, PLFLT *intensity,
  1046.         PLFLT *coord1, PLFLT *coord2, PLFLT *coord3);
  1047.  
  1048. /* Set a given color from color map 0 by 8 bit RGB value */
  1049.  
  1050. void
  1051. c_plscol0(PLINT icol0, PLINT r, PLINT g, PLINT b);
  1052.  
  1053. /* Set the background color by 8 bit RGB value */
  1054.  
  1055. void
  1056. c_plscolbg(PLINT r, PLINT g, PLINT b);
  1057.  
  1058. /* Used to globally turn color output on/off */
  1059.  
  1060. void
  1061. c_plscolor(PLINT color);
  1062.  
  1063. /* Set the device (keyword) name */
  1064.  
  1065. void
  1066. c_plsdev(const char *devname);
  1067.  
  1068. /* Set window into device space using margin, aspect ratio, and */
  1069. /* justification */
  1070.  
  1071. void
  1072. c_plsdidev(PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy);
  1073.  
  1074. /* Set up transformation from metafile coordinates. */
  1075.  
  1076. void
  1077. c_plsdimap(PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax,
  1078.        PLFLT dimxpmm, PLFLT dimypmm);
  1079.  
  1080. /* Set plot orientation, specifying rotation in units of pi/2. */
  1081.  
  1082. void
  1083. c_plsdiori(PLFLT rot);
  1084.  
  1085. /* Set window into plot space */
  1086.  
  1087. void
  1088. c_plsdiplt(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
  1089.  
  1090. /* Set window into plot space incrementally (zoom) */
  1091.  
  1092. void
  1093. c_plsdiplz(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
  1094.  
  1095. /* Set the escape character for text strings. */
  1096.  
  1097. void
  1098. c_plsesc(char esc);
  1099.  
  1100. /* Set family file parameters */
  1101.  
  1102. void
  1103. c_plsfam(PLINT fam, PLINT num, PLINT bmax);
  1104.  
  1105. /* Set the output file name. */
  1106.  
  1107. void
  1108. c_plsfnam(const char *fnam);
  1109.  
  1110. /* Shade region. */
  1111.  
  1112. void
  1113. c_plshade(PLFLT **a, PLINT nx, PLINT ny, const char **defined,
  1114.       PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
  1115.       PLFLT shade_min, PLFLT shade_max,
  1116.       PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
  1117.       PLINT min_color, PLINT min_width,
  1118.       PLINT max_color, PLINT max_width,
  1119.       void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
  1120.       void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
  1121.       PLPointer pltr_data);
  1122.  
  1123. void
  1124. plshade1(PLFLT *a, PLINT nx, PLINT ny, const char *defined,
  1125.      PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
  1126.      PLFLT shade_min, PLFLT shade_max,
  1127.      PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
  1128.      PLINT min_color, PLINT min_width,
  1129.      PLINT max_color, PLINT max_width,
  1130.      void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
  1131.      void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
  1132.      PLPointer pltr_data);
  1133.  
  1134. void
  1135. plfshade(PLFLT (*f2eval) (PLINT, PLINT, PLPointer),
  1136.      PLPointer f2eval_data,
  1137.      PLFLT (*c2eval) (PLINT, PLINT, PLPointer),
  1138.      PLPointer c2eval_data,
  1139.      PLINT nx, PLINT ny,
  1140.      PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
  1141.      PLFLT shade_min, PLFLT shade_max,
  1142.      PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
  1143.      PLINT min_color, PLINT min_width,
  1144.      PLINT max_color, PLINT max_width,
  1145.      void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
  1146.      void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
  1147.      PLPointer pltr_data);
  1148.  
  1149. /* I've canned this for now */
  1150.  
  1151. void
  1152. c_plslpb(PLFLT lpbxmi, PLFLT lpbxma, PLFLT lpbymi, PLFLT lpbyma);
  1153.  
  1154. /* Set up lengths of major tick marks. */
  1155.  
  1156. void
  1157. c_plsmaj(PLFLT def, PLFLT scale);
  1158.  
  1159. /* Set up lengths of minor tick marks. */
  1160.  
  1161. void
  1162. c_plsmin(PLFLT def, PLFLT scale);
  1163.  
  1164. /* Set orientation.  Must be done before calling plinit. */
  1165.  
  1166. void
  1167. c_plsori(PLINT ori);
  1168.  
  1169. /* Set output device parameters.  Usually ignored by the driver. */
  1170.  
  1171. void
  1172. c_plspage(PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng,
  1173.       PLINT xoff, PLINT yoff);
  1174.  
  1175. /* Set the pause (on end-of-page) status */
  1176.  
  1177. void
  1178. c_plspause(PLINT pause);
  1179.  
  1180. /* Set stream number.  */
  1181.  
  1182. void
  1183. c_plsstrm(PLINT strm);
  1184.  
  1185. /* Set the number of subwindows in x and y */
  1186.  
  1187. void
  1188. c_plssub(PLINT nx, PLINT ny);
  1189.  
  1190. /* Set symbol height. */
  1191.  
  1192. void
  1193. c_plssym(PLFLT def, PLFLT scale);
  1194.  
  1195. /* Initialize PLplot, passing in the windows/page settings. */
  1196.  
  1197. void
  1198. c_plstar(PLINT nx, PLINT ny);
  1199.  
  1200. /* Initialize PLplot, passing the device name and windows/page settings. */
  1201.  
  1202. void
  1203. c_plstart(const char *devname, PLINT nx, PLINT ny);
  1204.  
  1205. /* Set up a new line style */
  1206.  
  1207. void
  1208. c_plstyl(PLINT nms, PLINT *mark, PLINT *space);
  1209.  
  1210. /* Sets the edges of the viewport to the specified absolute coordinates */
  1211.  
  1212. void
  1213. c_plsvpa(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
  1214.  
  1215. /* Set x axis labeling parameters */
  1216.  
  1217. void
  1218. c_plsxax(PLINT digmax, PLINT digits);
  1219.  
  1220. /* Set inferior X window */
  1221.  
  1222. void
  1223. plsxwin(PLINT window_id);
  1224.  
  1225. /* Set y axis labeling parameters */
  1226.  
  1227. void
  1228. c_plsyax(PLINT digmax, PLINT digits);
  1229.  
  1230. /* Plots array y against x for n points using Hershey symbol "code" */
  1231.  
  1232. void
  1233. c_plsym(PLINT n, PLFLT *x, PLFLT *y, PLINT code);
  1234.  
  1235. /* Set z axis labeling parameters */
  1236.  
  1237. void
  1238. c_plszax(PLINT digmax, PLINT digits);
  1239.  
  1240. /* Switches to text screen. */
  1241.  
  1242. void
  1243. c_pltext(void);
  1244.  
  1245. /* Sets the edges of the viewport with the given aspect ratio, leaving */
  1246. /* room for labels. */
  1247.  
  1248. void
  1249. c_plvasp(PLFLT aspect);
  1250.  
  1251. /* Creates the largest viewport of the specified aspect ratio that fits */
  1252. /* within the specified normalized subpage coordinates. */
  1253.  
  1254. void
  1255. c_plvpas(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect);
  1256.  
  1257. /* Creates a viewport with the specified normalized subpage coordinates. */
  1258.  
  1259. void
  1260. c_plvpor(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
  1261.  
  1262. /* Defines a "standard" viewport with seven character heights for */
  1263. /* the left margin and four character heights everywhere else. */
  1264.  
  1265. void
  1266. c_plvsta(void);
  1267.  
  1268. /* Set up a window for three-dimensional plotting. */
  1269.  
  1270. void
  1271. c_plw3d(PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0,
  1272.     PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0,
  1273.     PLFLT zmax0, PLFLT alt, PLFLT az);
  1274.  
  1275. /* Set pen width. */
  1276.  
  1277. void
  1278. c_plwid(PLINT width);
  1279.  
  1280. /* Set up world coordinates of the viewport boundaries (2d plots). */
  1281.  
  1282. void
  1283. c_plwind(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
  1284.  
  1285.     /* The rest for use from C only */
  1286.  
  1287. /* Returns a list of file-oriented device names and their menu strings */
  1288.  
  1289. void
  1290. plgFileDevs(char ***p_menustr, char ***p_devname, int *p_ndev);
  1291.  
  1292. /* Set the function pointer for the keyboard event handler */
  1293.  
  1294. void
  1295. plsKeyEH(void (*KeyEH) (PLKey *, void *, int *), void *KeyEH_data);
  1296.  
  1297. /* Sets an optional user exit handler. */
  1298.  
  1299. void
  1300. plsexit(int (*handler) (char *));
  1301.  
  1302.     /* Transformation routines */
  1303.  
  1304. /* Identity transformation. */
  1305.  
  1306. void
  1307. pltr0(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
  1308.  
  1309. /* Does linear interpolation from singly dimensioned coord arrays. */
  1310.  
  1311. void
  1312. pltr1(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
  1313.  
  1314. /* Does linear interpolation from doubly dimensioned coord arrays */
  1315. /* (column dominant, as per normal C 2d arrays). */
  1316.  
  1317. void
  1318. pltr2(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
  1319.  
  1320. /* Just like pltr2() but uses pointer arithmetic to get coordinates from */
  1321. /* 2d grid tables.  */
  1322.  
  1323. void
  1324. pltr2p(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
  1325.  
  1326. /* Identity transformation for plots from Fortran. */
  1327.  
  1328. void
  1329. pltr0f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data);
  1330.  
  1331. /* Does linear interpolation from doubly dimensioned coord arrays */
  1332. /* (row dominant, i.e. Fortran ordering). */
  1333.  
  1334. void
  1335. pltr2f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data);
  1336.  
  1337. /* Example linear transformation function for contour plotter. */
  1338.  
  1339. void
  1340. xform(PLFLT x, PLFLT y, PLFLT * tx, PLFLT * ty);
  1341.  
  1342.     /* Function evaluators */
  1343.  
  1344. /* Does a lookup from a 2d function array.  Array is of type (PLFLT **), */
  1345. /* and is column dominant (normal C ordering). */
  1346.  
  1347. PLFLT
  1348. plf2eval2(PLINT ix, PLINT iy, PLPointer plf2eval_data);
  1349.  
  1350. /* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
  1351. /* and is column dominant (normal C ordering). */
  1352.  
  1353. PLFLT
  1354. plf2eval(PLINT ix, PLINT iy, PLPointer plf2eval_data);
  1355.  
  1356. /* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
  1357. /* and is row dominant (Fortran ordering). */
  1358.  
  1359. PLFLT
  1360. plf2evalr(PLINT ix, PLINT iy, PLPointer plf2eval_data);
  1361.  
  1362.     /* Command line parsing utilities */
  1363.  
  1364. /* Front-end to Syntax() for external use. */
  1365.  
  1366. void
  1367. plSyntax(PLINT mode);
  1368.  
  1369. /* Front-end to Help() for external use. */
  1370.  
  1371. void
  1372. plHelp(PLINT mode);
  1373.  
  1374. /* Print usage notes. */
  1375.  
  1376. void
  1377. plNotes(void);
  1378.  
  1379. /* Process PLplot internal options list */
  1380.  
  1381. int
  1382. plParseInternalOpts(int *p_argc, char **argv, PLINT mode);
  1383.  
  1384. /* Process options list */
  1385.  
  1386. int
  1387. plParseOpts(int *p_argc, char **argv, PLINT mode, PLOptionTable *option_table,
  1388.         void (*usage_handler) (char *));
  1389.  
  1390. /* Process input strings, treating them as an option and argument pair. */
  1391.  
  1392. int
  1393. plSetInternalOpt(char *opt, char *optarg);
  1394.  
  1395.     /* Miscellaneous */
  1396.  
  1397. /* Set the output file pointer */
  1398.  
  1399. void
  1400. plgfile(FILE **p_file);
  1401.  
  1402. /* Get the output file pointer */
  1403.  
  1404. void
  1405. plsfile(FILE *file);
  1406.  
  1407. /* Get the escape character for text strings. */
  1408.  
  1409. void
  1410. plgesc(char *p_esc);
  1411.  
  1412. /* Front-end to driver escape function. */
  1413.  
  1414. void
  1415. pl_cmd(PLINT op, void *ptr);
  1416.  
  1417. /* Return full pathname for given file if executable */
  1418.  
  1419. int
  1420. plFindName(char *p);
  1421.  
  1422. /* Looks for the specified executable file according to usual search path. */
  1423.  
  1424. char *
  1425. plFindCommand(char *fn);
  1426.  
  1427. /* Gets search name for file by concatenating the dir, subdir, and file */
  1428. /* name, allocating memory as needed.  */
  1429.  
  1430. void
  1431. plGetName(char *dir, char *subdir, char *filename, char **filespec);
  1432.  
  1433. /* Prompts human to input an integer in response to given message. */
  1434.  
  1435. PLINT
  1436. plGetInt(char *s);
  1437.  
  1438. /* Prompts human to input a float in response to given message. */
  1439.  
  1440. PLFLT
  1441. plGetFlt(char *s);
  1442.  
  1443.     /* Nice way to allocate space for a vectored 2d grid */
  1444.  
  1445. /* Allocates a block of memory for use as a 2-d grid of PLFLT's.  */
  1446.  
  1447. void
  1448. plAlloc2dGrid(PLFLT ***f, PLINT nx, PLINT ny);
  1449.  
  1450. /* Frees a block of memory allocated with plAlloc2dGrid(). */
  1451.  
  1452. void
  1453. plFree2dGrid(PLFLT **f, PLINT nx, PLINT ny);
  1454.  
  1455. /* Functions for converting between HLS and RGB color space */
  1456.  
  1457. void
  1458. plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b);
  1459.  
  1460. void
  1461. plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s);
  1462.  
  1463. /* Wait for right button mouse event and translate to world coordinates */
  1464.  
  1465. int
  1466. plGetCursor(PLCursor *cursor);
  1467.  
  1468. /* Utility functions for use with Tk */
  1469.  
  1470. #if defined(TK) || defined(_TK)
  1471. #include <tk.h>
  1472.  
  1473. /* Generic initialization routine for extended wish'es. */
  1474.  
  1475. int
  1476. Pltk_Init( Tcl_Interp *interp );
  1477.  
  1478. /* Main program for wish, with PLplot extensions. */
  1479.  
  1480. int
  1481. pltkMain(int argc, char **argv);
  1482. #endif
  1483.  
  1484. #ifdef __cplusplus
  1485. }
  1486. #endif
  1487.  
  1488. #endif    /* __PLPLOT_H__ */
  1489.